package com.jwsoft.manager.core.dao.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 数据备份任务详情表
 *
 * @author zhiyuan
 * @since 2023-09-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("edu_data_task_detail")
@Schema(name = "EduDataTaskDetail", title = "数据备份任务详情表", description = "数据备份任务详情表实体类")
public class EduDataTaskDetail extends Model<EduDataTaskDetail> {

    private static final long serialVersionUID = 1L;

    @Schema(name = "taskDetailId", description = "任务详情id")
    @TableId(value = "task_detail_id", type = IdType.INPUT)
    private String taskDetailId;

    @Schema(name = "taskId", description = "任务id")
    @TableField(value = "task_id")
    private String taskId;

    @Schema(name = "handleTable", description = "操作表名")
    @TableField(value = "handle_table")
    private String handleTable;

    @Schema(name = "migrationTable", description = "备份表名")
    @TableField(value = "migration_table")
    private String migrationTable;

    @Schema(name = "tempTable", description = "临时表名")
    @TableField(value = "temp_table")
    private String tempTable;

    @Schema(name = "year", description = "年度")
    @TableField(value = "year")
    private Integer year;

    @Schema(name = "migrationCount", description = "迁移数量")
    @TableField(value = "migration_count")
    private Integer migrationCount;

    @Schema(name = "migrationStatus", description = "迁移状态 0待迁移  1迁移成功  2迁移失败")
    @TableField(value = "migration_status")
    private String migrationStatus;

    @Schema(name = "migrationRemarks", description = "迁移备注")
    @TableField(value = "migration_remarks")
    private String migrationRemarks;

    @Schema(name = "migrationTime", description = "迁移时间")
    @TableField(value = "migration_time")
    private Date migrationTime;

    @Schema(name = "encryptCount", description = "加密数量")
    @TableField(value = "encrypt_count")
    private Integer encryptCount;

    @Schema(name = "encryptStatus", description = "加密状态 0待加密  1加密成功  2加密失败")
    @TableField(value = "encrypt_status")
    private String encryptStatus;

    @Schema(name = "encryptRemarks", description = "加密备注")
    @TableField(value = "encrypt_remarks")
    private String encryptRemarks;

    @Schema(name = "encryptTime", description = "加密时间")
    @TableField(value = "encrypt_time")
    private Date encryptTime;

    @Schema(name = "cleanCount", description = "销毁数量")
    @TableField(value = "clean_count")
    private Integer cleanCount;

    @Schema(name = "cleanStatus", description = "历史数据销毁状态 0待销毁  1销毁成功  2销毁失败")
    @TableField(value = "clean_status")
    private String cleanStatus;

    @Schema(name = "cleanRemarks", description = "销毁备注")
    @TableField(value = "clean_remarks")
    private String cleanRemarks;

    @Schema(name = "cleanTime", description = "销毁时间")
    @TableField(value = "clean_time")
    private Date cleanTime;

    @Schema(name = "tempCleanCount", description = "临时数据清空数量")
    @TableField(value = "temp_clean_count")
    private Integer tempCleanCount;

    @Schema(name = "tempCleanStatus", description = "临时数据清空状态 0待销毁  1销毁成功  2销毁失败")
    @TableField(value = "temp_clean_status")
    private String tempCleanStatus;

    @Schema(name = "tempCleanRemarks", description = "临时数据清空备注")
    @TableField(value = "temp_clean_remarks")
    private String tempCleanRemarks;

    @Schema(name = "tempCleanTime", description = "临时数据清空时间")
    @TableField(value = "temp_clean_time")
    private Date tempCleanTime;

    @Schema(name = "del", description = "0,未删除,1,已删除")
    @TableField(value = "del", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @Schema(name = "createName", description = "创建人")
    @TableField(value = "create_name", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;

    @Schema(name = "createTime", description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    @Schema(name = "updateName", description = "修改人")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;

    @Schema(name = "updateTime", description = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @Override
    public Serializable pkVal() {
        return this.taskDetailId;
    }
}
